var back_times = 0;

function keybackTwiceExit(){
    api.addEventListener({　　　　
        name: 'keyback'　　
    }, function(ret, err) {
        if (back_times == 1) {
            api.closeWidget({
                silent: true
            });
        }　
        else {
            back_times = 1;
            api.toast({
                msg: '再点一次退出应用',
                duration: 2000,
                location: 'bottom'
            });
            setTimeout(function() {
                back_times = 0;
            }, 2000);
        }
    });
}
